<ul class="pagination pagination-sm no-margin pull-right">
    <li><a class="first">首页</a></li>
	<li><a class="pre">上一页</a></li>
	<li><a class="next">下一页</a></li>
	<li><a class="last">尾页</a></li>
	<li><a class="rowCount">总记录数(0)</a></li>
	<li><a class="pageCount">总页数(0)</a></li>
	<li><a class="pageCurrent">当前页(1)</a></li>
</ul>
<script type="text/javascript">
	$(()=>{
		$("#pageId").on("click", ".first,.pre,.next,.last", doJumpToPage);
	})

	//分页事件处理函数
	function doJumpToPage() {
		let cls = $(this).prop("class");//$(this)指向被点击的对象

		let pageCurrent = $("#pageId").data("pageCurrent");
		let pageCount = $("#pageId").data("pageCount");
		if (cls == "first") {
			pageCurrent = 1;
		}else if (cls == "pre" && pageCurrent > 1) {
			pageCurrent--;
		}else if (cls == "next" && pageCurrent < pageCount) {
			pageCurrent++;
		}else if (cls == "last") {
			pageCurrent = pageCount;
		}else {
			return;
		}
		$("#pageId").data("pageCurrent",pageCurrent);
		doGetObjects();
	}
	//初始化页面上的分页信息
	function doSetPageInation(pageObject) {
		$(".rowCount").html(`总记录数(${pageObject.rowCount})`);
		$(".pageCount").html(`总页数(${pageObject.pageCount})`);
		$(".pageCurrent").html(`当前页(${pageObject.pageCurrent})`);
		//存储当前页码值和总页数，其目的是在需要时，可以直接从pageId获取
		$("#pageId").data("pageCurrent",pageObject.pageCurrent);
		$("#pageId").data("pageCount",pageObject.pageCount);
	}
</script>








